package com.gkey.demo.redis;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

/**
 * 集群
 * @author Gkey
 *
 */
public class RedisClusterDemo {
	
	public void demo1(){		
		Config config = new Config();		
		//config.setUseLinuxNativeEpoll(true);
		config.useClusterServers().addNodeAddress("192.168.1.10:7001","192.168.1.10:7002","192.168.1.10:7003"
				,"192.168.1.10:7004","192.168.1.10:7005","192.168.1.10:7006");
		RedissonClient redission = Redisson.create(config);
		
		redission.shutdown();
	}
	
	
	public void demo2(){
		Config config = new Config();		
		config.useSingleServer().setAddress("192.168.1.10:7001");
		RedissonClient redission = Redisson.create(config);
		
		redission.shutdown();
		
	}
	public static void main(String[] args) {
		RedisClusterDemo p = new RedisClusterDemo();
		p.demo1();
		
		
	}

}
